﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using System.Configuration;
using Ext.Net;
namespace TCDC_System.UserControl
{
    public partial class RoleAdd : System.Web.UI.UserControl
    {
        private tcdc_mst_role obj;

        protected void Page_Load(object sender, EventArgs e)
        {
            obj = new tcdc_mst_role();
            obj.strConn = ConfigurationManager.AppSettings["ConnString"];
        }

        public void Show()
        {
            WindowRoleAdd.Show();
        }

        protected void SaveRole(object sender, DirectEventArgs e)
        {
            obj.role_name = txt_role_name.Text;
            obj.create_date = txt_create_date.Text;
            obj.create_by = Convert.ToInt32(txt_create_by.Text);
            obj.update_date = txt_update_date.Text;
            obj.update_by = Convert.ToInt32(txt_update_by.Text);
            obj.insertData(obj);
            GridStore.DataSource = obj.getByObject(new tcdc_mst_role());
            GridStore.DataBind();
            FormPanel1.Reset();
            WindowRoleAdd.Hide();
        }
        public Store GridStore { get; set; }
    }
}

